package com.luge.composedemo

import android.app.Dialog
import android.util.Log
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key.Companion.D
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog

@Composable
fun LoginPage(){
    var  state by remember {
        mutableStateOf(1)
    }

    var  state2 = remember {
        mutableStateOf(1)
    }

    var (value,setValue)  = remember {
        mutableStateOf(1)
    }





   Text(text = "HELLO")

   LaunchedEffect(state){
       Log.d("luge", Thread.currentThread().name)
       if(state == 1){//刷新

       }
   }

    //Dialog

    var showDialog by remember{
        mutableStateOf(false)
    }


    Column(
      modifier = Modifier.fillMaxSize(),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ){
        Button(
            onClick = {
                showDialog = true
            }
        ){
            //
        }
//
//        if(showDialog){
//            Dialog(onDismissRequest = { showDialog = false }, content = {
//                Column(
//                    modifier = Modifier.fillMaxSize(),
//                    horizontalAlignment = Alignment.CenterHorizontally,
//                    verticalArrangement = Arrangement.Center
//                ){
//                    Button(
//                        onClick = {
//                            showDialog = true
//                        }
//                    ){
//                        //
//                    }
//            })
//        }
//
//        Card()
//    }
//        Card(
//            elevation = 10.dp
//        ){
//
//        }


}
